//
//  ParkingCell.m
//  PropertyMananger
//
//  Created by bh on 17/1/4.
//  Copyright © 2017年 BH. All rights reserved.
//

#import "ParkingCell.h"

@implementation ParkingCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}
+ (instancetype)cellWithTableView:(UITableView *)tableView
{
    static NSString * parkingCellID = @"parkingCellID";
    
    ParkingCell * cell = [[ParkingCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:parkingCellID];
    if (cell == nil) {
        
        cell = [tableView dequeueReusableCellWithIdentifier:parkingCellID];
    }
     cell.selectionStyle = UITableViewCellSelectionStyleNone;
  //  cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator; //显示最右边的箭头
    return cell;

}
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        
        self.imgView = [[UIImageView alloc]init];
        [self.contentView addSubview:self.imgView];
       
        [self.imgView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.leading.equalTo(self).with.offset(15);
            make.centerY.equalTo(self).with.offset(0);
            make.size.mas_equalTo(CGSizeMake(25, 25));
        }];
        
        self.titleLabel = [[UILabel alloc]init];
        [self.contentView addSubview:self.titleLabel];
        self.titleLabel.textColor = BHColor(51, 51, 51);
        
        self.titleLabel.font = BHFont(15);
        self.titleLabel.textAlignment = NSTextAlignmentLeft;
        
        [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.leading.equalTo(self.imgView.mas_trailing).with.offset(10);
            make.centerY.equalTo(self).with.offset(0);
            make.size.mas_equalTo(CGSizeMake(BHscreenW/4+10, 25));
        }];
        
        self.infoLabel = [[UILabel alloc]init];
        [self.contentView addSubview:self.infoLabel];
        
        self.infoLabel.textColor = BHColor(51, 51, 51);
        self.infoLabel.textAlignment = NSTextAlignmentRight;
        self.infoLabel.font = BHFont(15);
     //  self.infoLabel.backgroundColor = BHRandColor;
        
        [self.infoLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.trailing.equalTo(self).with.offset(-10);
            make.centerY.equalTo(self).with.offset(0);
            make.size.mas_equalTo(CGSizeMake(BHscreenW/3, 25));
        }];
        
        
        
    }
    return self;
}
@end
